OTRcvRequest
You use theOTRcvRequest
function to read a request from a connection-oriented transaction-based requester.C INTERFACE
OSStatus OTRcvRequest (EndpointRef ref, TRequest* req, OTFlags* reqFlags);C++ INTERFACE
OSStatus TEndpoint::RcvRequest(TRequest* req, OTFlags* flags);PPARAMETERS
ref
- The endpoint reference of the endpoint reading the request.
req
- A pointer to a
TRequest
structure (page 3-66) that contains information, on return, about the incoming request. See the description of theTRequest
structure for how to set this parameter when doing a no-copy receive.reqFlags
- A bitmapped long specifying, on return, whether there is more request data coming (
T_MORE
) and whether the provider is going to acknowledge replies (T_ACKNOWLEDGED
).DESCRIPTION
You use theOTRcvRequest
function to read an incoming request. After reading the request, you can use theOTSndReply
function to reply to that request or theOTCancelRequest
function to reject the request.When the
OTRcvRequest
function returns, thereq->data.buf
field points to the request data and thereq->sequence
field specifies a transaction ID for this transaction. You must use this same sequence value when calling theOTSndReply
function to reply to this request or theOTCancelRequest
function to reject it.If you have allocated a buffer that is too small to hold the request data, the provider sets the
T_MORE
bit in thereqFlags
field to indicate that there is more request data to be read. You must call theOTRcvRequest
function until theT_MORE
flag is cleared in order to retrieve the rest of the request data. Thereq->opt
field contains returns no information for these additional calls.If the endpoint is in synchronous mode and is blocking, the
OTRcvRequest
function returns only when a request arrives. If the endpoint is asynchronous or is not blocking, theOTRcvRequest
function returns either the next unread request or thekOTNoDataErr
result if there are no pending requests.If flow-control restrictions prevent the provider from accepting the data when you call the
OTRcvRequest
function, the function returns thekOTFlowErr
result. The provider issues theT_GODATA
event when flow-control restrictions are lifted.When a request arrives, the provider generates a
T_REQUEST
event. You can poll for this event using theOTLook
function or call the function for as long as thekOTNoDataErr
result is returned. If you have a notifier installed for this endpoint, the event is sent to the notifier.VALID STATES
T_DATAXFER
,T_OUTREL
SEE ALSO
You use theOTSndReply
function (described next) to reply to a request that you have read using theOTRcvRequest
function.You can use the
OTLook
function to poll forT_REQUEST
events (page 3-85).